{{extends file="admin/admin_header.tpl"}}
{{block name="content"}}
<form action="{{site_url("document/Sort?data=cate")}}" method="post">
<h3>栏目管理
	<button type="submit" class="btn btn-sm btn-success" style="margin-left:20px;">排序</button>
	<span style="font-size:14px;color:red;">温馨提示：请谨慎添加或删除栏目，一级栏目不可删除。</span>
	<div class="pull-right">
		<a href="{{site_url("document/TypeList")}}" class="btn btn-sm btn-success">
			分类列表
		</a>
		<a href="{{site_url('category/add')}}" class="btn btn-sm btn-success">添加新栏目</a>
	</div>
</h3>
<div class="table-responsive">
	<table class="table table-striped table-bordered table-hover">
		<thead>
			<tr>
				<th>排序</th>
				<th>Id</th>
				<th>栏目名称</th>
				<th>栏目类型</th>
				<th style="text-align: center;">操作</th>
			</tr>
		</thead>
		<tbody>
			{{foreach $category as $v}}
			<tr>
				<td><input type="text" style="width:50px;height:20px;text-align:center;" name="{{$v.Id}}" value="{{$v.Sort}}"></td>
				<td>{{$v.Id}}</td>
				<td>{{$v.CateName}}</td>
				<td>{{$v.Type}}</td>
				<td style="text-align: center;width: 10%;">
					<a href="{{site_url("category/edit?Id={{$v.Id}}")}}" class="btn btn-xs btn-primary">编辑</a>
					{{assign var="deletehref" value="{{site_url("category/delete?Id={{$v.Id}}")}}"}}
					<a href="javascript:void(0)" onclick="modal('{{$deletehref}}')" class="btn btn-xs btn-danger">删除</a>
				</td>
			</tr>
			{{/foreach}}
		</tbody>
	</table>
</div>
</form>
{{/block}}
